var t,
  i =
    (t = require("../../../../config/page")) && t.__esModule
      ? t
      : { default: t },
  e = require("../../../../utils/jump"),
  a = require("@/services/list");
Component({
  properties: {
    isShow: {
      type: Boolean,
      value: !1,
      observer: function (t) {
        t ? (this.initList(), this.showCard()) : this.closeCard();
      },
    },
    activeIndex: { type: Number, value: 0 },
  },
  data: { info: {} },
  methods: {
    initList: function () {
      var t = (0, a.getWorshipList)(),
        i = this.data.activeIndex,
        e = t[i],
        o = "";
      switch (i) {
        case 0:
          o = "width: 100%; height: 100%;position:absolute;top: 0;opacity:0.5";
          break;
        case 1:
          o =
            "width: 100%; height: 100%;position:absolute;top: -100rpx;left:-20rpx;opacity:0.5;";
          break;
        case 2:
          o =
            "width: 100%; height: 100%;position:absolute;top: -80rpx;left:42rpx;opacity:0.5;";
          break;
        case 3:
          o =
            "width: 70%; height: 70%;position:absolute;top: 0;left:80rpx;opacity:0.5;";
          break;
        case 4:
          o =
            "width: 70%;height: 70%;position: absolute;top: -40rpx;left: 70rpx;opacity: 0.5;";
          break;
        case 5:
          o =
            "width: 80%; height: 80%;position:absolute;top: -80rpx;left:20rpx;opacity:0.5";
          break;
        case 6:
          o =
            "width: 100%; height: 100%;position:absolute;top: -100rpx;opacity:0.5;";
      }
      this.setData({
        info: {
          bg_img: [
            "https://industry.map.qq.com/cloud/file/2023/06/20/1687245901049_Aihyc5Bh.png",
            "https://industry.map.qq.com/cloud/file/2023/06/20/1687245933330_A8ejDCNP.png",
            "https://industry.map.qq.com/cloud/file/2023/06/20/1687245965409_zBx7AzWd.png",
            "https://industry.map.qq.com/cloud/file/2023/06/20/1687245992819_YhAyA9sA.png",
            "https://industry.map.qq.com/cloud/file/2023/06/20/1687246010580_MAcXyNBt.png",
            "https://industry.map.qq.com/cloud/file/2023/06/20/1687246032484_CSbwBWst.png",
            "https://industry.map.qq.com/cloud/file/2023/06/20/1687246050646_atjPbb9f.png",
          ][i],
          name: e.instance.instanceName,
          desc: e.instance.properties.description,
          list: e.originalPic.map(function (t) {
            return {
              id: t.id,
              pic: "https://pckgs.sxd.cn/9999/" + t.fileThumbnail,
              materialTitle: t.name,
            };
          }),
          imgStyle: o,
        },
      });
    },
    toDetail: function () {
      var t = this.data.activeIndex;
      (0, e.navigateTo)(i.default.PAGE_APPRECIATION_PAGES_LIFE_INDEX, {
        activeIndex: t,
      });
    },
    toCollectionCard: function (t) {
      var a = t.currentTarget.dataset.index;
      (0, e.navigateTo)(i.default.PAGE_APPRECIATION_COLLECTION_CARD_INDEX, {
        id: a,
      });
    },
    closeCard: function () {
      var t = this,
        i = wx.createAnimation({ duration: 500, timingFunction: "ease" });
      i.translateY(600).step(), this.setData({ animationData: i.export() });
      var e = setTimeout(function () {
        clearTimeout(e), (e = 0), t.triggerEvent("onClose", {});
      }, 220);
    },
    showCard: function () {
      var t = this,
        i = wx.createAnimation({ duration: 400, timingFunction: "ease" }),
        e = setTimeout(function () {
          i.translateY(0).step(),
            t.setData({ animationData: i.export() }),
            clearTimeout(e),
            (e = 0);
        }, 100);
    },
  },
});
